/*
 * Copyright (C) 2019 ByteDance Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bytedance.scene.navigation;

import ohos.aafwk.ability.Ability;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

/**
 * Created by JiangQi on 7/30/18.
 */
class ActivityStatusRecord implements Sequenceable {
    private int mStatusBarColor;
    private int mNavigationBarColor;
    private int mSystemUiVisibility;
    private int mSoftInputMode;
    private int mWindowFlags;
    private int mRequestedOrientation;


    public boolean marshalling(Parcel out) {
        return out.writeInt(mStatusBarColor) &&
                out.writeInt(mNavigationBarColor) &&
                out.writeInt(mSystemUiVisibility) &&
                out.writeInt(mSoftInputMode) &&
                out.writeInt(mWindowFlags) &&
                out.writeInt(mRequestedOrientation);
    }

    public boolean unmarshalling(Parcel in) {
        this.mStatusBarColor = in.readInt();
        this.mNavigationBarColor = in.readInt();
        this.mSystemUiVisibility = in.readInt();
        this.mSoftInputMode = in.readInt();
        this.mWindowFlags = in.readInt();
        this.mRequestedOrientation = in.readInt();
        return true;
    }

    public static final Sequenceable.Producer PRODUCER = new Sequenceable.Producer() {
        public ActivityStatusRecord createFromParcel(Parcel in) {
            // Initialize an instance first, then do customized unmarshlling.
            ActivityStatusRecord instance = new ActivityStatusRecord();
            instance.unmarshalling(in);
            return instance;
        }
    };


    public static ActivityStatusRecord newInstance(Ability ability) {
        ActivityStatusRecord record = new ActivityStatusRecord();
        return record;
    }

    public void restore(Ability ability) {

    }
}
